Skip to content

Madagascar custom shapefile#575

Open
nitinmagima wants to merge 11 commits intomasterfrom
madagascar_custom_shapefile
Open

Madagascar custom shapefile#575
nitinmagima wants to merge 11 commits intomasterfrom
madagascar_custom_shapefile

Conversation

@nitinmagima
Copy link
Contributor

Hi Aaron,

I update the yaml file to take in the new shapefiles where the new admin 0 and 1 shapefiles have been created using the admin 2 files. On running the dashboard in the server however I get this error. It doesn't seem like a code error but a server error?

Best,
Nitin

image

@aaron-kaplan
Copy link
Collaborator

aaron-kaplan commented Oct 28, 2025 via email

@nitinmagima
Copy link
Contributor Author

Seems like there's still a format issue even when all three layers exist. No errors are generated when the map is loaded. I'm guessing it's something to how fiona is reading the new shapefiles. Does it expect it it to have a particular hierarchy?

http://mako.iri.columbia.edu:16526/fbfmaproom/

@aaron-kaplan
Copy link
Collaborator

I found three distinct problems:

  1. The zip file doesn't have the structure that fiona expects. I'm not sure how it should be structured, so for now I've unpacked the zip.
  2. The Madagascar shapes are in a projected coordinate system, with units of meters, whereas the application expects a geographic coordinate system, with units of degrees. The Djibouti shapes worked because they use a geographic coordiate system.
  3. A bug in the application code caused the error mesage to be silently discarded instead of being printed on the console.

I've pushed changes to this branch to fix 1 and 3. @nitinmagima please pull my changes, and then see if you can figure out how to reproject/deproject the shapes.

Also please share your script for constructing and deprojecting the shapes, because eventually I'd like to put that logic in the application. If the application can handle shapes in whatever form we find them, rather than requiring pre-processing, it will make it easier to add new shapes.

@aaron-kaplan
Copy link
Collaborator

@mm5330 @nitinmagima what is going on? Github says Max just pushed two commits authored by Nitin that duplicate work Max did on a different branch.

There should be nothing about Ethiopia on this branch. This branch is for Madagascar changes.

@mm5330
Copy link
Contributor

mm5330 commented Nov 3, 2025

@mm5330 @nitinmagima what is going on? Github says Max just pushed two commits authored by Nitin that duplicate work Max did on a different branch.

There should be nothing about Ethiopia on this branch. This branch is for Madagascar changes.

Oh weird, this wasn't me. Not sure how that happened...

@nitinmagima
Copy link
Contributor Author

nitinmagima commented Nov 3, 2025 via email

@aaron-kaplan aaron-kaplan force-pushed the madagascar_custom_shapefile branch from 54337df to a29f0da Compare November 11, 2025 00:45
@aaron-kaplan
Copy link
Collaborator

I've added Nitin's script to this repo, and modified it to remove the holes that dissolve left in the shapes. It seems to be working now:

http://mako.iri.columbia.edu:9998/fbfmaproom/madagascar

A couple things to note:

  1. The shapes are quite slow to load even for me, located in the US. It remains to be seen how usable this is for people in Madagascar.
  2. We changed the outer boundary to include the entire country (used to only include the four southernmost regions), but we haven't expanded the obs data to cover the entire country, so you get errors if you click too far north. @dantesab9 if you want to fix this, you can do so by modifying the Y (latitude) bounds in the Ingrid URLs (which now live in the config file) and rerunning fbf-update-data.py. Alternatively, since we're already modifying the shapefile, it would be easy enough to change the script to exclude regions to the north that aren't of interest. That would probably also help with the speed.

@dantesab9 let me know what you want to do.

@aaron-kaplan
Copy link
Collaborator

BTW I rebased this branch to get rid of the weird repeated commits from Max. If you pulled it before and you try to pull again, it will get complicated. I don't think anyone needs to do that, but if you do, I can help.

@dantesab9
Copy link
Contributor

Hi Aaron, thank for this update too, the map look very good! About the obs data coverage, I think it is best to extend to the full country since we will use some districts that are not in the prior "national" polygon and also we may need to provide data for more northern districts that are part of the other, newer, red cross project. I'll take a look at the latitude question and also start working in updating the polygon IDs in the markdowns.

@aaron-kaplan
Copy link
Collaborator

@dantesab9 are we making progress towards merging this? I just referred Max to it as an example to follow for Ethiopia, and I presume others will follow eventually. It would be good to get it into the main branch so it doesn't get out of sync with the rest of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments